﻿namespace MhAdmin.System;

/// <summary>
/// 编码规则分页查询参数
/// </summary>
public class RulesPageInput : BasePageInput
{
    /// <summary>
    /// 名称
    /// </summary>
    public string RuleName { get; set; }

    /// <summary>
    /// 类别
    /// </summary>
    public string RuleClass { get; set; }

    /// <summary>
    /// 编号
    /// </summary>
    public string RuleCode { get; set; }

    /// <summary>
    /// 前缀
    /// </summary>
    public string Header { get; set; }
}

/// <summary>
/// 添加编码规则参数
/// </summary>
public class RulesAddInput
{
    /// <summary>
    /// 名称
    /// </summary>
    [Required(ErrorMessage = "RuleName不能为空")]
    public string RuleName { get; set; }

    /// <summary>
    /// 编号（通过编号关联，唯一）
    /// </summary>
    [Required(ErrorMessage = "RuleCode不能为空")]
    public string RuleCode { get; set; }

    /// <summary>
    /// 类型（数据字典）
    /// </summary>
    [Required(ErrorMessage = "RuleType不能为空")]
    public string RuleType { get; set; }

    /// <summary>
    /// 分类(数据字典)
    /// </summary>
    [Required(ErrorMessage = "RuleClass不能为空")]
    public string RuleClass { get; set; }

    /// <summary>
    /// 前缀
    /// </summary>
    public string Header { get; set; }

    /// <summary>
    /// 中间时间格式
    /// </summary>
    public string MiddleTime { get; set; }

    /// <summary>
    /// 后缀(长度)
    /// </summary>
    [Required(ErrorMessage = "LastLen不能为空")]
    public int? LastLen { get; set; }

    /// <summary>
    /// 起始量
    /// </summary>
    public int StartValue { get; set; }
}

/// <summary>
/// 修改编码规则参数
/// </summary>
public class RulesEditInput : RulesAddInput
{
    /// <summary>
    /// Id
    /// </summary>
    [IdNotNull(ErrorMessage = "Id不能为空")]
    public long Id { get; set; }
}

public class RulesTestInput
{
    /// <summary>
    /// 规则编号
    /// </summary>
    [Required(ErrorMessage = "规则编号不能为空")]
    public string RuleCode { get; set; }

    /// <summary>
    /// 测试数量
    /// </summary>
    [IdNotNull(ErrorMessage = "测试数量不能为空")]
    public int Length { get; set; }
}
